package weeek11.topic10;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class BitMapTest {
    public static void main(String[] args) {
        JedisPool jedisPool = JedisPoolUtil.getJedisPool();
        String bitKey = "test_bit_map";
        try (Jedis jedis = jedisPool.getResource()) {
            jedis.del(bitKey);
            //init
            for (int i = 0; i < 1000; i+=2) {
                jedis.setbit(bitKey,i,true);
            }
            //test
            for (int i = 0; i < 10; i++) {
                Boolean bit = jedis.getbit(bitKey, i);
                System.out.println(i+":"+bit);
            }
        }
    }
}
